package org.rainbowinverted.charging.device.connect.ykc.server.message.in;

import org.rainbowinverted.charging.device.connect.ykc.server.constants.YkcDeviceChargeStopReasonEnum;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 设备充电记录
 * @author hehuaiping
 */
@Data
public class YkcDeviceChargeRecordIn implements Serializable {
    /**
     * 订单编号
     */
    private String orderNo;
    /**
     * 设备编号
     */
    private Long deviceNo;
    /**
     * 设备编号
     */
    private Integer gunNo;
    /**
     *  开始充电时间
     */
    private LocalDateTime startTime;
    /**
     *  结束充电时间
     */
    private LocalDateTime endTime;
    /**
     * 充电电量
     */
    private Integer chargeElectricity;
    /**
     * 充电费用
     */
    private Integer chargeFee;
    /**
     * 停止原因
     */
    private YkcDeviceChargeStopReasonEnum stopReason;
    /**
     * 卡号
     */
    private Long cardNo;

    public static YkcDeviceChargeRecordIn of(String orderNo, Long deviceNo, Integer gunNo, LocalDateTime startTime,
                                             LocalDateTime endTime, Integer chargeElectricity,
                                             Integer chargeFee, YkcDeviceChargeStopReasonEnum stopReason, Long cardNo) {
        return new YkcDeviceChargeRecordIn(orderNo, deviceNo, gunNo, startTime, endTime, chargeElectricity,
                chargeFee, stopReason, cardNo);
    }

    private YkcDeviceChargeRecordIn(String orderNo, Long deviceNo, Integer gunNo, LocalDateTime startTime,
                                   LocalDateTime endTime, Integer chargeElectricity,
                                   Integer chargeFee, YkcDeviceChargeStopReasonEnum stopReason, Long cardNo) {
        this.orderNo = orderNo;
        this.deviceNo = deviceNo;
        this.gunNo = gunNo;
        this.startTime = startTime;
        this.endTime = endTime;
        this.chargeElectricity = chargeElectricity;
        this.chargeFee = chargeFee;
        this.stopReason = stopReason;
        this.cardNo = cardNo;
    }
}
